home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000097_icon-group-sender_Tue Oct 24 13:25:33 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKPJD24283
for icon-group-addresses; Tue, 24 Oct 2000 13:25:20 -0700 (MST)
Message-Id: <200010242025.e9OKPJD24283@baskerville.CS.Arizona.EDU>
From: symbiot@my-deja.com
X-Newsgroups: comp.lang.icon
Subject: Re: How to "declare" a string?
Date: Tue, 24 Oct 2000 18:05:48 GMT
To: cheyenne_wills@qwest.net
X-Article-Creation-Date: Tue Oct 24 18:05:48 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
X-Http-Proxy: 1.0 SRVPROXY, 1.0 x63.deja.com:80 (Squid/1.1.22) for client 208.51.185.226
X-MyDeja-Info: XMYDJUIDsymbiot
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1562
Neat function! Thanks for the suggestion. Any ideas about the the first
question?
In article <39F35C09.4A9C93A1@qwest.net>,
Cheyenne Wills <cheyenne_wills@qwest.net> wrote:
>
> > traditional sense of a programming language. Soooo...uhhh....???
> >
> > As a secondary question, this is part of a program to converst a
string
> > to all uppercase. Right now I'm doing in a WHILE...DO loop. But
> > something tells me there's amcuh more efficient way to do it (with
EVERY
> > perhaps?) Any suggestions?
>
> data := "Some MiXed CaSed Data"
> newdata := map(data,&lcase,&ucase)
>
> --> newdata now contains "SOME MIXED CASED DATA"
>
> The map function searches in the first parameter every instance of
each
> character in the second parameter and replaces that character with a
> character from the third parameter that is in the same "position" as
the
> character in the 2nd...
>
> I hope that sounded clear...
>
> Here is an example:
>
> # 12345 12345
> map("some data","aeiou","!@#$%") -> "s$m# d!t!"
>
> The above does the following mapping
>
> a -> !
> e -> @
> i -> #
> o -> $
> u -> %
>
> You can also use map to rearrange data
> # mm/dd/yyyy yyyy/mm/dd mm/dd/yyyy
> map("123456789A","789A612345","10/21/2000")
>
> Will transform a date in the format of mm/dd/yyyy into yyyy/mm/dd. It
> uses the third parameter as the "input"
>
> Cheyenne
>
--
"Wife who put husband in doghouse, soon find him in cathouse."
-- Wisdom of the Tao
Sent via Deja.com http://www.deja.com/
Before you buy.